package com.atguigu.java;

import org.junit.Test;

import java.util.Comparator;

/**
 * @author wxw
 * @create 2021-03-29 15:57
 */
public class LambdaTest {
    @Test
    public void test1(){
        Runnable r1 =new Runnable() {
            @Override
            public void run() {
                System.out.println("我爱北京天安门");
            }
        };
        r1.run();
        Runnable r2 =()-> System.out.println("我爱北京");
        r2.run();
    }
    @Test
    public void test2(){
        Comparator<Integer> com1 =(o1, o2)->Integer.compare(o1,o2);
        int compare = com1.compare(1, 2);
        System.out.println(compare);


    }
}
